#coding=utf-8
import tensorflow as tf
from datasets import dataset_factory
import tensorflow.contrib.slim as slim

def prepare_voc2017():
    # Select the dataset.
    dataset = dataset_factory.get_dataset(
        name = 'pascalvoc_2012', 
        split_name = 'train', 
        dataset_dir = '/home/raintai/guoyf/VOC/VOCdevkit/VOC2012')
    # Create a dataset provider and batches.
    PARALLEL_NUM_READER = 4
    BATCH_SIZE = 32
    provider = slim.dataset_data_provider.DatasetDataProvider(
				    dataset,
				    # The number of parallel readers that read data from the dataset
				    num_readers = PARALLEL_NUM_READER,
				    common_queue_capacity = 20 * BATCH_SIZE,
				    common_queue_min = 10 * BATCH_SIZE,
				    shuffle = True)
    # Get for SSD network: image, labels, bboxes.
    [image, shape, glabels, gbboxes] = provider.get([ \
    'image', 'shape', 'object/label', 'object/bbox'])
if __name__ == '__main__':
    prepare_voc2017()
    print 'OK'
